using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Crainiate.Data.Persistence.Tools
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DeploymentApplication app = new DeploymentApplication();
            
            DeploymentForm form = new DeploymentForm();
            app.MainForm = form;

            //Loop through wizard
            while (app.Step > 0 && app.Step < 5)
            {
                app.ProcessStep();
            }

            //Show main form if stepped through
            if (app.Step > 0)
            {
                form.Deployment = app.SqlDeploymentForm.Deployment;
                form.Context = app.SqlDeploymentForm.Context;
                form.Assembly = app.SelectAssemblyForm.Assembly;
                form.Databases = app.SqlDeploymentForm.Databases;

                Application.Run(app);
            }
        }
    }
}